package com.gitee.nacos.myregistrar;

import org.springframework.boot.web.context.WebServerInitializedEvent;
import org.springframework.context.ApplicationListener;

public class MyAbstractAutoServiceRegistration implements ApplicationListener<WebServerInitializedEvent> {

    private MyNacosServiceRegistry registration;

    public MyAbstractAutoServiceRegistration(MyNacosServiceRegistry registration) {
        this.registration = registration;
    }

    @Override
    public void onApplicationEvent(WebServerInitializedEvent event) {
        registration.register();
    }
}
